package com.rural.bus.driver.model;

import org.json.JSONException;
import org.json.JSONObject;


public class Msg {
	
	public String action;
	public String message;
	public Order order;
	
	public static Msg parse(String json){
		try {
			Msg msg=new Msg();

			JSONObject object=new JSONObject(json);
			msg.action=object.getString("action");
			msg.message=object.getString("message");
			msg.order=Order.parse(object.getJSONObject("order"));
			return msg;
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

}
